﻿using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Orchard.ContentManagement;
using Orchard.Core.Common.Utilities;
using SchoolPointe.Menus.Enums;

namespace SchoolPointe.Menus.Models
{
    public class BetterMenuItemPart : ContentPart<BetterMenuItemPartRecord>
    {
        public BetterMenuItemPart()
        {
            this.RelatedItem = new LazyField<ContentItem>();
        }
        [Required]
        [DisplayName("Display Text")]
        public string Text
        {
            get { return Record.Text; }
            set { Record.Text = value; }
        }

        [DisplayName("Subtitle")]
        public string SubTitle
        {
            get { return Record.SubTitle; }
            set { Record.SubTitle = value; }
        }

        public string Url
        {
            get { return Record.Url; }
            set { Record.Url = value; }
        }

        public MenuItemType MenuItemType
        {
            get { return (MenuItemType)Record.MenuItemType; }
            set { Record.MenuItemType = (int)value; }
        }

        public int SortOrder
        {
            get { return Record.SortOrder; }
            set { Record.SortOrder = value; }
        }

        public LazyField<ContentItem> RelatedItem { get; private set; }
    }
}